<#macro uploadFileBtn2 itemValue itemProperName inputId btnName fileTypes>
<div>
	路径<input id="${inputId}" readonly="readonly" name="${itemProperName}" class="easyui-validatebox textbox" data-options="required: true"  value="${itemValue!}"/>
	
	<span id="upload_${inputId}"></span>
	<span id="upload_${inputId}_Show">
	<#if itemValue??&&itemValue!=''>
	<img src="${itemValue!}" width="320" height="110"/>
	</#if>	
	</span>
</div>
<span style="display:none">
	<input id="${inputId}_Cancel" type="button" value="取消全部上传" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 22px;" />
</span>

<script>
var swfInstrPhoto = new SWFUpload({
	flash_url : "static/plugins/swfupload/swfupload.swf",
   upload_url: "common.do?uploadFile",
   file_post_name:"filedata",
   post_params: {"name" : "zwm"},
   use_query_string:true,
       file_size_limit : "70 MB",
	   file_types : "${fileTypes!'*.*'}",    //这是全部文件都可以上传，如果要限制只有某些文件上传，则可以这么写 file_types : "*.jpg;*.gif;*.png",
       file_types_description : "图片",
       file_queue_limit : 0,
       custom_settings : {
           progressTarget : "fsUploadProgress",
           cancelButtonId : "${inputId}_Cancel"
       },

       button_image_url : "static/plugins/swfupload/swfbtn.png",
 		button_placeholder_id : "upload_${inputId}",
 		button_text: "<span class='abtn'>${btnName}</span>",
 		button_window_mode:"transparent",
 		button_width: 80,
 		button_height: 24,
 		button_text_left_padding: 22,
 		button_text_top_padding: 2,
       file_queued_handler : fileQueued,
       file_queue_error_handler : fileQueue_${inputId}_Error,
       file_dialog_complete_handler : fileDialogComplete,
       upload_error_handler : upload_${inputId}_Error,
       upload_success_handler : upload_${inputId}_Success,
       upload_complete_handler : uploadComplete,
       queue_complete_handler : queueComplete    // Queue plugin event
});

function fileQueue_${inputId}_Error(file,error,message) {
	printLog(file);
	printLog(error);
	
	switch(error)
	{
		case -110:
		  showMsg("上传的文件【"+file.name + "】大小超过70M，无法上传",4000);
		  break;
		case -130:
		  showMsg("上传的文件【"+file.name + "】类型不对",4000);
		  break;
		default:
	}
	
}



function upload_${inputId}_Error(file,code,message) {
	//showMsg(message);
}

function upload_${inputId}_Success(file,rs) {
	  var json = eval('(' + rs + ')');
	  $('#upload_${inputId}_Show').html('<img src="'+json.obj+'" width="320" height="110"/>');	
	  $('#${inputId}').val(json.obj);
	}
</script>
</#macro>



<#macro uploadFileBtn itemValue itemProperName inputId btnName fileTypes>
<input id="${inputId}" name="${itemProperName}" type="hidden"  value="${itemValue!}"/>
<div>
	<span id="upload_${inputId}"></span>
	<span id="upload_${inputId}_Show">
	<#if itemValue??>
	<img src="${itemValue!}" width="320" height="105"/>
	</#if>	
	</span>
</div>
<span style="display:none">
	<input id="${inputId}_Cancel" type="button" value="取消全部上传" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 22px;" />
</span>

<script>
var swfInstrPhoto = new SWFUpload({
	flash_url : "static/plugins/swfupload/swfupload.swf",
   upload_url: "common.do?uploadFile",
   file_post_name:"filedata",
   post_params: {"name" : "zwm"},
   use_query_string:true,
       file_size_limit : "70 MB",
	   file_types : "${fileTypes!'*.*'}",    //这是全部文件都可以上传，如果要限制只有某些文件上传，则可以这么写 file_types : "*.jpg;*.gif;*.png",
       file_types_description : "图片",
       file_queue_limit : 0,
       custom_settings : {
           progressTarget : "fsUploadProgress",
           cancelButtonId : "${inputId}_Cancel"
       },

       button_image_url : "static/plugins/swfupload/swfbtn.png",
 		button_placeholder_id : "upload_${inputId}",
 		button_text: "<span class='abtn'>${btnName}</span>",
 		button_window_mode:"transparent",
 		button_width: 80,
 		button_height: 24,
 		button_text_left_padding: 22,
 		button_text_top_padding: 2,
       file_queued_handler : fileQueued,
       file_queue_error_handler : fileQueue_${inputId}_Error,
       file_dialog_complete_handler : fileDialogComplete,
       upload_error_handler : upload_${inputId}_Error,
       upload_success_handler : upload_${inputId}_Success,
       upload_complete_handler : uploadComplete,
       queue_complete_handler : queueComplete    // Queue plugin event
});

function fileQueue_${inputId}_Error(file,error,message) {
	printLog(file);
	printLog(error);
	
	switch(error)
	{
		case -110:
		  showMsg("上传的文件【"+file.name + "】大小超过70M，无法上传",4000);
		  break;
		case -130:
		  showMsg("上传的文件【"+file.name + "】类型不对",4000);
		  break;
		default:
	}
	
}



function upload_${inputId}_Error(file,code,message) {
	//showMsg(message);
}

function upload_${inputId}_Success(file,rs) {
	  var json = eval('(' + rs + ')');
	  $('#upload_${inputId}_Show').html('<img src="'+json.obj+'" width="135" height="136"/>');	
	  $('#${inputId}').val(json.obj);
	}
</script>
</#macro>